﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using WalkingTec.Mvvm.Core;
using System.Text.Json.Serialization;
using Digitalmes.Model;
using Digitalmes.Model.ReworkManagement;
using Digitalmes.Model.ProductManagement;

namespace Digitalmes.Model.ReworkManagement
{
    /// <summary>
    /// 返工原因
    /// </summary>
	[Table("ReworkReason")]

    [Display(Name = "_Model.ReworkReason")]
    public class ReworkReason : BasePoco,IPersistPoco,ITenant
    {
        [Key]
        [Display(Name = "_Model._ReworkReason._ID")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public new long ID { get; set; }
        [Display(Name = "_Model._ReworkReason._ProductId")]
        [Comment("适用产品")]
        public long? ProductId { get; set; }


        public Product Product { get; set; }

        [Display(Name = "_Model._ReworkReason._ProductName")]
        [Comment("产品名称")]
        public string ProductName { get; set; }
        [Display(Name = "_Model._ReworkReason._ReasonName")]
        [Comment("原因名称")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public string ReasonName { get; set; }
        [Display(Name = "_Model._ReworkReason._ReasonCode")]
        [Comment("原因编码")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public string ReasonCode { get; set; }
        [Display(Name = "_Model._ReworkReason._Active")]
        [Comment("激活")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public bool? Active { get; set; }
        [Display(Name = "_Model._ReworkReason._ReType")]
        [Comment("返工类型")]
        public ReworkType ReType { get; set; }
        [Display(Name = "_Model._ReworkReason._ReType")]
        [Comment("返工类型")]
        public long? ReTypeId { get; set; }
        [Display(Name = "_Model._ReworkReason._IsValid")]
        [Comment("是否有效")]
        [Required(ErrorMessage = "Validate.{0}required")]
        public bool IsValid { get; set; } = true;
        [StringLength(50, ErrorMessage = "Validate.{0}stringmax{1}")]
        public string TenantCode { get; set; }

	}

}
